// 上传表单对象
export const formData = {
  fork: {
    name: { label: '判断节点', value: 'fork' },
    params: {
      condition: { label: '条件', value: '', options: ['特征数', '边缘数'], show: true },
      operator: { label: '操作符', value: '', options: ['>', '<', '=', '≥', '≤'], show: true },
      condition_value: { label: '条件值', value: '', show: true }
    }
  },
  start: {
    id: 0,
    name: { label: '图像源', value: 'img_src' },
    params: {
      img_src_type: { label: '源类型', value: '', options: ['上传', '图片源', '视频源'], show: true },
      img: { label: '图片', value: '', type: 'img', show: true, group: [0] },
      src: { label: '图片源选择', value: '', options: [], show: true, group: [1, 2] },
      video_src: { label: '视频源选择', value: '', options: [], show: false, group: [1, 2] },
      screen_type: { label: '取图方式', value: '', options: [0, 1], show: false },
      interval: { label: '取图间隔', value: '', show: false },
      total: { label: '取图总数', value: '', show: false }
    }
  },
  channels: {
    id: 1,
    name: { label: '通道变更', value: 'changeChannels' },
    params: {
      channels: { label: '通道', value: '', options: ['GRAY', 'HSV'], show: true }
    }
  },
  clip: {
    id: 2,
    name: { label: '裁剪', value: 'clip' },
    params: {
      x1: { label: 'x起点', value: '', show: true },
      x2: { label: 'x终点', value: '', show: true },
      y1: { label: 'y起点', value: '', show: true },
      y2: { label: 'y终点', value: '', show: true }
    }
  },
  resize: {
    id: 3,
    name: { label: '缩放', value: 'resize' },
    params: {
      width: { label: '宽度', value: '', show: true },
      height: { label: '高度', value: '', show: true },
      inter_method: { label: '插值方法', value: '', options: ['双线性插值', '双三次插值'], show: true }
    }
  },
  rotate: {
    id: 4,
    name: { label: '旋转', value: 'rotate' },
    params: {
      rotateCode: { label: '角度', value: '', options: [90, 180, 270], show: true }
    }
  },
  threshold: {
    id: 5,
    name: { label: '阈值化', value: 'threshold' },
    params: {
      thresholdtype: { label: '阈值化方法', value: '', options: ['binary', 'binary-inv', 'trunc', 'tozero', 'tozero-inv', 'mask', 'otsu', 'triangle'], show: true },
      thresh: { label: '阈值', value: '', show: true },
      maxval: { label: '最大阈值', value: '', show: true }
    }
  },
  blur: {
    id: 6,
    name: { label: '滤波', value: 'blur' },
    params: {
      blur_type: { label: '滤波方法', value: '', options: ['gauss', 'median', 'mean', 'bilateral', 'box'], show: true },
      ksize: { label: '核大小', value: '', show: false },
      sigmaX: { label: 'sigmaX', value: '', show: false },
      sigmaY: { label: 'sigmaY', value: '', show: false },
      d: { label: 'd', value: '', show: false },
      sigmaColor: { label: 'sigmaColor', value: '', show: false },
      sigmaSpace: { label: 'sigmaSpace', value: '', show: false },
      ddepth: { label: 'ddepth', value: '', show: false },
      normalize: { label: 'normalize', value: '', show: false }
    }
  },
  denoising: {
    id: 7,
    name: { label: '去噪', value: 'denoising' },
    params: {
      denosing_type: { label: '去噪种类', value: '', options: ['fastNlMeans', 'fastNlMeansColored', 'fastNlMeansMulti', 'fastNlMeansColoredMulti'], show: true },
      h: { label: '过滤器强度', value: '', show: false },
      hColor: { label: '彩图过滤器强度', value: '', show: false },
      templateWindowSize: { label: 'templateWindowSize', value: '', show: false },
      searchWindowSize: { label: 'searchWindowSize', value: '', show: false },
      temporalWindowSize: { label: 'temporalWindowSize', value: '', show: false },
      index: { label: '去噪索引', value: '', show: false }
    }
  },
  morphology: {
    id: 8,
    name: { label: '形态学', value: 'morphology' },
    params: {
      morphology_type: { label: '操作', value: '', options: ['erode', 'dilate', 'morphologyEx'], show: true },
      kernel: { label: '核大小', value: '', show: false },
      iterations: { label: '迭代次数', value: '', show: false },
      op: { label: '形态学操作', value: '', options: ['OPEN', 'CLOSE', 'GRADIENT', 'TOPHAT', 'BLACKHAT'], show: false }
    }
  },
  // template: {
  //   id: 9,
  //   name: { label: '模板匹配', value: 'template' },
  //   params: {
  //     model: { label: '模板', value: '', show: true }
  //   }
  // },
  edge: {
    id: 10,
    name: { label: '边缘检测', value: 'edge' },
    params: {
      edge_type: { label: '操作', value: '', options: ['sobel', 'canny', 'robert'], show: true },
      low_threshold: { label: '最小阈值', value: '', show: false },
      high_threshold: { label: '最大阈值', value: '', show: false }
    }
  },
  contour: {
    id: 11,
    name: { label: '轮廓检测', value: 'contour' },
    params: {
      thresh: { label: '阈值', value: '', show: true }
    },
    results: {
      // amount: { label: '轮廓数量', value: '', show: true },
      // area: { label: '轮廓面积', value: '', show: true },
      // perimeter: { label: '轮廓周长', value: '', show: true },
      // center: { label: '轮廓中心', value: '', show: true }
    }
  },
  hough: {
    id: 12,
    name: { label: '霍夫变换', value: 'hough' },
    params: {
      type: { label: '种类', value: '', options: ['直线', '圆'], show: true }
    }
  },
  feature: {
    id: 13,
    name: { label: '特征检测', value: 'feature' },
    params: {
      feature_type: { label: '操作', value: '', options: ['sift', 'surf'], show: true }
    }
  },
  perspective: {
    id: 14,
    name: { label: '透视变换', value: 'perspective' },
    params: {}
  },
  // remap: {
  //   id: 13,
  //   name: { label: '畸变矫正', value: 'remap' },
  //   params: {
  //     cameraMatrix: { label: '角度', value: '', show: true },
  //     distCoeffs: { label: '角度', value: '', show: true },
  //     newCameraMatrix: { label: '角度', value: '', show: true }
  //   }
  // },
  hist: {
    id: 15,
    name: { label: '像素统计', value: 'hist' },
    params: {}
  },
  params: {
    name: { label: '读取参数', value: 'params' },
    params: {}
  },
  OCR: {
    id: 16,
    name: { label: 'ocr识别', value: 'OCR' },
    params: {}
  },
  ai: {
    id: 17,
    name: { label: 'ai算子', value: 'ai' },
    params: {
      ai_type: { label: '算子种类', value: '', options: ['图像分类', '目标检测', '图像分割'], show: true },
      model_name: { label: '模型名称', value: '', options: [], show: true }
    }
  }
}

export const filter = {
  gauss: {
    id: 0,
    name: { label: '高斯滤波', value: 'gaussianBlur' },
    params: {
      ksize: { label: '核大小', value: '', show: false },
      sigmaX: { label: 'sigmaX', value: '', show: false },
      sigmaY: { label: 'sigmaY', value: '', show: false }
    }
  },
  median: {
    id: 1,
    name: { label: '中值滤波', value: 'medianBlur' },
    params: {
      ksize: { label: '核大小', value: '', show: false }
    }
  },
  mean: {
    id: 2,
    name: { label: '均值滤波', value: 'blur' },
    params: {
      ksize: { label: '核大小', value: '', show: false }
    }
  },
  bilateral: {
    id: 3,
    name: { label: '双边滤波', value: 'bilateralFilter' },
    params: {
      d: { label: 'd', value: '', show: false },
      sigmaColor: { label: 'sigmaColor', value: '', show: false },
      sigmaSpace: { label: 'sigmaSpace', value: '', show: false }
    }
  },
  box: {
    id: 4,
    name: { label: '方框滤波', value: 'boxFilter' },
    params: {
      ddepth: { label: 'ddepth', value: '', show: false },
      ksize: { label: 'ksize', value: '', show: false },
      normalize: { label: 'normalize', value: '', show: false }
    }
  },
  filter2D: {
    id: 5,
    name: { label: '自定义滤波', value: 'filter2D' },
    params: {
      ddepth: { label: 'ddepth', value: '', show: false },
      kernel: { label: 'kernel', value: '', show: false }
    }
  }
}

export const denoise = {
  fastNlMeans: {
    id: 0,
    name: { label: '快速非局部均值去噪', value: 'fastNlMeans' },
    params: {
      h: { label: 'h', value: '', show: false },
      templateWindowSize: { label: 'templateWindowSize', value: '', show: false },
      searchWindowSize: { label: 'searchWindowSize', value: '', show: false }
    }
  },
  fastNlMeansColored: {
    id: 1,
    name: { label: '彩色图像快速非局部均值去噪', value: 'fastNlMeansColored' },
    params: {
      h: { label: 'h', value: '', show: false },
      hColor: { label: 'hColor', value: '', show: false },
      templateWindowSize: { label: 'templateWindowSize', value: '', show: false },
      searchWindowSize: { label: 'searchWindowSize', value: '', show: false }
    }
  },
  fastNlMeansMulti: {
    id: 2,
    name: { label: '多通道快速非局部均值去噪', value: 'fastNlMeansMulti' },
    params: {
      index: { label: 'imgToDenoiseIndex', value: '', show: false },
      temporalWindowSize: { label: 'temporalWindowSize', value: '', show: false },
      h: { label: 'h', value: '', show: false },
      templateWindowSize: { label: 'templateWindowSize', value: '', show: false },
      searchWindowSize: { label: 'searchWindowSize', value: '', show: false }
    }
  },
  fastNlMeansColoredMulti: {
    id: 3,
    name: { label: '多通道彩色图像快速非局部均值去噪', value: 'fastNlMeansColoredMulti' },
    params: {
      index: { label: 'imgToDenoiseIndex', value: '', show: false },
      temporalWindowSize: { label: 'temporalWindowSize', value: '', show: false },
      h: { label: 'h', value: '', show: false },
      templateWindowSize: { label: 'templateWindowSize', value: '', show: false },
      searchWindowSize: { label: 'searchWindowSize', value: '', show: false }
    }
  }
}

export const morphologyOp = {
  erode: {
    id: 0,
    name: { label: '腐蚀', value: 'erode' },
    params: {
      kernel: { label: 'kernel', value: '', show: false },
      iterations: { label: 'anchor', value: '', show: false }
    }
  },
  dilate: {
    id: 1,
    name: { label: '膨胀', value: 'dilate' },
    params: {
      kernel: { label: 'kernel', value: '', show: false },
      iterations: { label: 'anchor', value: '', show: false }
    }
  },
  morphologyEx: {
    id: 2,
    name: { label: '形态学操作', value: 'morphologyEx' },
    params: {
      op: { label: 'op', value: '', show: false },
      kernel: { label: 'kernel', value: '', show: false }
    }
  }
}

export const edgeop = {
  canny: {
    id: 0,
    name: { label: 'canny', value: 'canny' },
    params: {
      low_threshold: { label: '最小阈值', value: '', show: false },
      high_threshold: { label: '最大阈值', value: '', show: false }
    }
  },
  sobel: {
    id: 1,
    name: { label: 'sobel', value: 'sobel' },
    params: {}
  },
  robert: {
    id: 2,
    name: { label: 'robert', value: 'robert' },
    params: {}
  }
}

export const featureop = {
  sift: {
    id: 0,
    name: { label: 'sift', value: 'sift' },
    params: {}
  },
  surf: {
    id: 1,
    name: { label: 'surf', value: 'surf' },
    params: {}
  }
}
